package case2Object_oriented;

/**
 * @program: AlibabaJavaIntroduction
 * @description: 人的类
 * @author: 朱志文
 * @create: 2021-12-21 22:05
 **/
public class Person {
    private String name;
    private int age;

    public void tell(){
        System.out.println(name+'-'+age);
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age>0){
            this.age = age;
        }
    }

}
